package com.xinzhidi.common.constant;

/**
 * netty协议 常量
 *
 * @author cx
 */
public class AgreementConstants {

    /**
     * 数据状态--未删除
     */
    public static final String DEL_FLAG_NO = "0";

    /**
     * 数据状态--已删除
     */
    public static final String DEL_FLAG_YES = "1";


    /**
     * 协议类型
     */
    public static class AgreementType {
        /**
         * 1 户用阀门协议
         * 2 单元阀门协议
         * 3 室温采集器
         * 4 户用热量表
         * 5 单元热量表-188-超声波楼栋热量表通讯协议
         * 6 海龙马调节阀协议
         * 7 楼栋阀门协议
         * 8 楼栋热量表协议
         */
        public static final String HOUSEHOLD_VALVE = "1";
        public static final String UNIT_VALVE = "2";
        public static final String GREENHOUSE_COLLECTOR = "3";
        public static final String HOUSEHOLD_HEAT_METER = "4";
        public static final String UNIT_HEAT_METER = "5";
        public static final String SEAHORSE_VALVE_METER = "6";
        public static final String BUILD_VALVE = "7";
        public static final String BUILD_HEAT_METER = "8";
    }

    /**
     * 协议类型中文名
     */
    public static class AgreementTypeName {
        /**
         * 1 户用阀门协议
         * 2 单元阀门协议
         * 3 室温采集器
         * 4 户用热量表
         * 5 单元热量表-188-超声波楼栋热量表通讯协议
         * 6 海龙马调节阀协议
         * 7 楼栋阀门协议
         * 8 楼栋热量表协议
         */
        public static final String HOUSEHOLD_VALVE = "户用阀门协议 ";
        public static final String UNIT_VALVE = "单元阀门协议";
        public static final String GREENHOUSE_COLLECTOR = "室温采集器协议";
        public static final String HOUSEHOLD_HEAT_METER = "户用热量表协议";
        public static final String UNIT_HEAT_METER = "单元热量表通讯协议";
        public static final String SEAHORSE_VALVE_METER = "海龙马调节阀协议";
        public static final String BUILD_VALVE= "楼栋阀门协议";
        public static final String BUILD_HEAT_METER = "楼栋热量表协议";
    }

    /**
     * 指令类型（发送/接收）
     */
    public static class InstructionType {
        /**
         * 1 发送
         * 2 接收
         */
        public static final String SEND = "1";
        public static final String RECEIVE = "2";

    }

    /**
     * 是否高低位（如果为1，则需要颠倒顺序，比如：0050表示开度50%，颠倒后为5000）
     */
    public static class IsHighLowPosition {
        /**
         * 0 否
         * 1 是
         */
        public static final String ZERO = "0";
        public static final String ONE = "1";
    }

    /**
     * 指令发送状态
     */
    public static class InstructSendingState {
        /**
         * 0：待发送
         * 1 已发送
         * 2 发送成功
         * 3 发送失败
         * 4 回复正常
         * 5 回复异常
         * 6 回复超时
         */
        public static final String WAIT_TO_SENT = "0";
        public static final String BEEN_SENT = "1";
        public static final String SEND_SUCCESS = "2";
        public static final String SEND_FAILURE = "3";
        public static final String RETURN_TO_NORMAL = "4";
        public static final String RETURN_EXCEPTION = "5";
        public static final String RETURN_TIMEOUT = "6";
    }


    /**
     * 设备类型
     */
    public static class EquipmentType {
        /**
         * 1 热量表
         * 2 阀门
         * 3 室温采集器
         */
        public static final String HEAT_METER = "1";
        public static final String VALVE = "2";
        public static final String TEMPERATURE_COLLECTOR = "3";
    }

    /**
     * 数据类型
     */
    public static class DataType {
        /**
         * 0 小区
         * 1 楼栋
         * 2 单元
         * 3 住户
         */
        public static final String PLOT = "0";
        public static final String BUILD = "1";
        public static final String BUILD_UNIT = "2";
        public static final String HOUSEHOLD = "3";
    }

    /**
     * 调控策略
     */
    public static class ControlTactics {
        /**
         * 1 回水温度
         * 2 室内温度
         * 3 供回水平均温度
         * 4 流量
         * 5 热量
         */
        public static final String RETURN_WATER_TEMPERATURE = "1";
        public static final String ROOM_TEMPERATURE = "2";
        public static final String AVERAGE_AND_RETURN_WATER = "3";
        public static final String FLOW_RATE = "4";
        public static final String HEAT = "5";
        public static final String VALVE_OPEN = "6";
    }

    /**
     * 优先级
     */
    public static class PriorityType {
        /**
         * 1 楼栋
         * 2 单元
         */
        public static final Integer BUILD = 1;
        public static final Integer BUILD_UNIT = 2;

    }

    /**
     * 指令业务类型
     */
    public static class InstructBusinessType {
        /**
         * 1 手动抄表
         * 2 自动抄表
         * 3 初始设置
         * 4 平衡调控
         * 5 存档恢复
         * 6 设备重连
         */
        public static final Integer MANUAL_METER_READ = 1;
        public static final Integer AUTO_METER_READ = 2;
        public static final Integer DATA_SET = 3;
        public static final Integer EQUILIBRIUM_REGULATION = 4;
        public static final Integer ARCHIVE_RECOVERY = 5;
        public static final Integer OTHER = 6;

    }

    /**
     * 异常类型
     */
    public static class ExceptionType {
        /**
         * 1 通讯异常
         * 2 超限异常
         * 3 波动异常
         */
        public static final String  COMMUNICATION_EXCEPTION = "1";
        public static final String  TRANSFINITE_EXCEPTION = "2";
        public static final String  UNDULATE_EXCEPTION = "3";
    }

    /**
     * 异常类型名称
     */
    public static class ExceptionName {
        /**
         * 1 通讯异常
         * 2 超限异常
         * 3 波动异常
         */
        public static final String RETURN_WATER_TEMPERATURE = "回水温度异常";
        public static final String ROOM_TEMPERATURE = "室内温度异常";
        public static final String SUPPLY_AND_RETURN_WATER = "供回水平均温度异常";
        public static final String FLOW_RATE = "流量异常";
        public static final String HEAT = "热量异常";
    }


}
